﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Young3.FMSearch.Core.Attributes;

namespace Young3.FMSearch.Core.Entities.GameVersions
{
    internal class Steam_10_3 : IIVersion
    {
        public Steam_10_3()
        {
            MemoryAddresses = new VersionMemoryAddresses();
            PersonEnum = new VersionPersonEnumPointers();
        }

        public string Description
        {
            get { return "10.3 Steam"; }
        }

        public bool SupportsProcess(FMProcess process)
        {
            return process.VersionDescription == "10.3.0f104859";
        }

        public IVersionMemoryAddresses MemoryAddresses { get; private set; }
        public IVersionPersonEnumPointers PersonEnum { get; private set; }

        public class VersionMemoryAddresses : IVersionMemoryAddresses
        {
            [MemoryAddress(CountLength = 4, BytesToSkip = 0x28)]
            public int City { get { return 0x200e424 - 0x1000; } }
            [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
            public int Club { get { return 0x200e428 - 0x1000; } }
            [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
            public int Continent { get { return 0x200e430 - 0x1000; } }
            [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
            public int Country { get { return 0x200e448 - 0x1000; } }
            [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
            public int League { get { return 0x200E42C - 0x1000; } }

            [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
            public int Language { get { return 0x200E440 - 0x1000; } }

            [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28)]
            public int Stadium { get { return 0x200E474 - 0x1000; } }
            [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28, ObjectOffset = 0)]
            public int Team { get { return 0x200E480 - 0x1000; } }
            [MemoryAddressAttribute(CountLength = 4, BytesToSkip = 0x28, ObjectOffset = 0)]
            public int Person { get { return 0x200E450 - 0x1000; } }

            public int CurrentDateTime { get { return 0x200E5D0 - 0x1000; } }
            public int ActiveObject { get { return 0x2009268 - 0x1000; } }
        }

        public class VersionPersonEnumPointers : IVersionPersonEnumPointers
        {
            public int Player { get { return 0x01b9b52c + 0x50; } }
            public int Staff { get { return 0x01bd0c6c + 0x50; } }
            public int PlayerStaff { get { return 0x01b8ce1c + 0x50; } }
            public int HumanManager { get { return 0x01b9a3dc + 0x50; } }
        }
    }
}
